<template>
  <div class="q-pa-md">
    <div class="q-gutter-md row items-start">
      <t-file
        v-model="files"
        label="Pick files"
        filled
        counter
        :counter-label="counterLabelFn"
        max-files="3"
        multiple
        style="max-width: 300px"
      >
        <template v-slot:prepend>
          <t-icon name="attach_file" />
        </template>
      </t-file>
    </div>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        files: ref(null),
        counterLabelFn({ totalSize, filesNumber, maxFiles }) {
          return `${filesNumber} files of ${maxFiles} | ${totalSize}`;
        },
      };
    },
  };
</script>
